#ifndef _MY_OSTREAM_ITERATOR_H_
#define _MY_OSTREAM_ITERATOR_H_

#include <iterator>
#include <ostream>
#include <string>

using namespace std;

template<typename T, typename CharT = char, typename Traits = char_traits<CharT>>
class my_ostream_iterator : public iterator<output_iterator_tag, void, void, void, void> {
	public:
		typedef CharT char_type;
		typedef Traits traits_type;
		typedef basic_ostream<CharT, Traits> ostream_type;
		
		my_ostream_iterator(ostream_type& os, const char_type* delim);
		my_ostream_iterator(ostream_type& os);
		~my_ostream_iterator();
		
		my_ostream_iterator& operator = (const T& value);
		my_ostream_iterator& operator * ();
		my_ostream_iterator& operator ++ ();
		my_ostream_iterator& operator ++ (int);
	
	private:
		ostream_type* os;
		const char_type* delim;
};

#include "my_ostream_iterator.tcc"

#endif

